﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="WebLosgic.Logins" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<script>var __links = document.querySelectorAll('a');
    function __linkClick(e) { parent.window.postMessage(this.href, '*'); };
    for (var i = 0, l = __links.length; i < l; i++)
    { if (__links[i].getAttribute('data-t') == '_blank') { __links[i].addEventListener('click', __linkClick, false); } }
</script>
<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
    <script>$(document).ready(function(c) {
	$('.alert-close').on('click', function(c){
		$('.message').fadeOut('slow', function(c){
	  		$('.message').remove();
		});
	});	  
});
        $(function () {
            $("#Button1").click(function () {
                var Accounts = $("#count").val();
                var Passwords = $("#pwd").val();

                $.ajax({
                    type: "POST",
                    url: "../HeanderAJAX/LoginHandler.ashx",
                    data: { "Act": Accounts, "pwd": Passwords },
                    async: false,
                    success: function (data) {
                        //alert(data);
                        if (data == "登录成功") {
                            window.location.href = "../index.aspx";
                        } else {
                            alert(data)
                        }


                    },
                    error: function (req) {
                        alert(req);
                    }
                });
                return false;//这个位置加一个返回失败
            })


        })
</script>

    <title></title>
</head>
<body>
    <div class="message warning">
<div class="inset">
	<div class="login-head">
		<h1>Rapid LMS</h1>
		 <%--<div class="alert-close"> </div> 	--%>		
	</div>
		<form id="from1" runat="server">
			<li>
				<input type="text" id="count" class="text" value="请输入账号" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '请输入账号';}"/><a href="#" class=" icon user"></a>
			</li>
				<div class="clear"> </div>
			<li>
				<input type="password" id="pwd" value="请输入密码" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '请输入密码';}"/> <a href="#" class="icon lock"></a>
			</li>
			<div class="clear"> </div>
			<div class="submit">
				<input type="submit"  value="登录"  runat="server" id="Button1"/>
				<h4><a href="#">忘记密码 ?</a></h4>
						  <div class="clear">  </div>	
			</div>
				
		</form>
		</div>	
        				
	</div>
	
	
<!--- footer --->

</body>
</html>
